#!/usr/bin  python
# _*_ coding:utf-8 _*_
"""
----------------------------------
    File Name: open_branch
    Description:
        Author: lhw
        Date: 2020/6/4
-----------------------------------
"""


def open_branch(all_data, arm_id=[]):
    data = []
    while len(arm_id) > 0:
        single_arm_id = arm_id.pop()
        for i in all_data:
            if i["parent_id"] == single_arm_id:
                data.append(i)
                arm_id.append(i['cid'])
    return data
